exports.orderProcessing = (req, res) => {

    var restfulParams = req.routeInfo.restfulParams;

    var resultData = {};

    var openid = 0;

    //查询订单
    function allOrderList(cb) {

        R.SEND_HTTP(
            req,
            res,
            {
                url: config.external_server.apiAddress + "/organization/search_art_product_order/apo_id/" + restfulParams.order_id,
                method: 'POST',
                data: {
                    fields: ['apo_contact', 'apo_phone', 'apo_no', 'apo_create_time', 'apo_openid', 'apo_status', 'apo_campus_name', 'apo_openid', 'apo_nickname'].join(",")
                }
            },
            function (data) {

                resultData.orderInfo = data.result.data;

                openid = data.result.data[0].apo_openid;

                cb();

            }
        )
    }

    //查询客户信息
    function customerInfo(cb) {

        var schoolName = '';

        if (openid != 0) {
            R.SEND_HTTP(
                req,
                res,
                {
                    url: CORE_APIConfig.coreAPI.artCustomerSearch.Request_Api_Url + "/c_openid/" + openid,
                    method: 'POST',
                    data: {
                        fields: ['c_campus_name'].join(",")
                    }
                },
                function (data) {


                    if (data.result.data.length > 0) {
                        schoolName = data.result.data[0].c_campus_name;
                    }

                    resultData.orderInfo[0].schoolName = schoolName;

                    cb();

                }
            )
        } else {
            resultData.orderInfo[0].schoolName = schoolName;

            cb();
        }

    }


    F.Serial([
        allOrderList,
        customerInfo,
    ], () => {
        RES.successResponse(res, resultData);
    })


}